<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<Style x:Key="ButtonFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<!-- 应该在此定义资源字典条目。-->
	<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#F3F3F3" Offset="0"/>
		<GradientStop Color="#EBEBEB" Offset="0.5"/>
		<GradientStop Color="#DDDDDD" Offset="0.5"/>
		<GradientStop Color="#CDCDCD" Offset="1"/>
	</LinearGradientBrush>
	<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
	<Style x:Key="TreeSortStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
		<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
		<Setter Property="HorizontalContentAlignment" Value="Center"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Padding" Value="1"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                      Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                        <ContentPresenter.Content>
                            <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"
                                    Background="{TemplateBinding Background}">
                                <Grid>
                                    <Image x:Name="sortTip" Height="16" Width="16" Source="ThemesImage\Sort.ico"/>
                                    <Image x:Name="unsortTip" Height="16" Width="16" Source="ThemesImage\UnSort.ico"/>

                                </Grid>
                            </Border>
                        </ContentPresenter.Content>
                    </ContentPresenter>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true">

                        </Trigger>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Visibility" TargetName="sortTip" Value="Visible"/>
                            <Setter Property="Visibility" TargetName="unsortTip" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter Property="Visibility" TargetName="sortTip" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="unsortTip" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#ADADAD"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>